/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package au.edu.swin.unilearn.tutorialGroup;

import java.io.Serializable;

/**
 *
 * @author DidierLeung
 */
public class TutorialGroupPK implements Serializable
{
    private Integer activity_no;
    private String subject_code;

    public TutorialGroupPK()
    {
    }

    public TutorialGroupPK(Integer activity_no, String subject_code)
    {
        this.activity_no = activity_no;
        this.subject_code = subject_code;
    }

    public Integer getActivity_no()
    {
        return activity_no;
    }

    public void setActivity_no(int activity_no)
    {
        this.activity_no = activity_no;
    }

    public String getSubject_code()
    {
        return subject_code;
    }

    public void setSubject_code(String subject_code)
    {
        this.subject_code = subject_code;
    }
    
    @Override
    public boolean equals(Object obj)
    {
        TutorialGroupPK pk = (TutorialGroupPK) obj;
        if(activity_no == pk.getActivity_no() && subject_code.equals(pk.getSubject_code()))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
    @Override
    public int hashCode()
    {
        return activity_no + subject_code.hashCode();
    }
    
    @Override
    public String toString()
    {
        return "au.edu.swin.tutorialGroup.TutorialGroupEntity[id=" + activity_no + "]";
    }
}
